Electronics Publications

Explore NKTECH Industries' innovative research in electronics, focusing on advanced automotive safety and security solutions.

Automobile Accident and Theft Prevention System

Authors: Muhammad Abdur Rehman, Amina Asif, Muhammad Shahbaz, Ahsan Ayaz

Affiliation: Department of Electrical and Computer Engineering, Air University, Islamabad 14220, Pakistan

Date: June 2025

Download Full Report (PDF)

Abstract

In today’s rapidly evolving technological landscape, integrating advanced sensor technologies is crucial for enhancing vehicle safety and security. The Automobile Accident and Theft Prevention System addresses this by incorporating drowsiness detection, alcohol and CO detection, battery theft detection, and tire theft sensors, all interfaced with a microcontroller. The system proactively mitigates accident risks by detecting driver impairments and environmental hazards, triggering actions such as rolling down windows for ventilation. Additionally, it enables real-time theft detection, notifying authorities of unauthorized component removal via GSM/GPS modules. This affordable, energy-efficient solution is compatible with any vehicle and operates independently of the car’s battery, ensuring continuous monitoring even when the vehicle is off.

Figure 1: Block Diagram of Main System

System block diagram

Figure 1: Block diagram of the Automobile Accident and Theft Prevention System, illustrating sensor and microcontroller integration.

1. Introduction

The Automobile Accident and Theft Prevention System integrates advanced sensor technologies with a microcontroller to address the persistent threats of vehicle accidents and thefts. By proactively detecting hazards such as driver drowsiness, alcohol or CO levels, and unauthorized component removal, the system enhances road safety and security. It leverages GSM/GPS modules for real-time alerts and location tracking, operating independently of the vehicle’s battery. Recent studies [1–4] highlight the effectiveness of integrated sensor systems in reducing response times and improving recovery outcomes. This cost-effective, self-sustaining solution is compatible with any vehicle, making it suitable for both urban and rural environments.

2. Literature Review

Advancements in vehicle safety and security emphasize real-time monitoring through sensor integration. Kumar et al. [1] highlight low-cost embedded systems, while Rao and Kumar [2] demonstrate Arduino-based accident detection. Hossain and Hassan [3] focus on cost-efficient GPS/GSM tracking, and Jain and Sharma [4] review integrated theft and accident alert systems. Additional studies [5–11] explore smart vehicle systems, air pollution monitoring, and tracking solutions. However, many existing systems are limited to single functions, are expensive, or rely on the vehicle’s battery, reducing accessibility for middle-class consumers. These systems often lack user-friendly interfaces, complicating installation and maintenance. This project proposes an affordable, all-in-one solution that combines accident prevention and theft detection, operating independently and efficiently.

3. Problem Statement

Despite advancements in automotive technology, vehicle accidents and thefts remain significant threats to public safety and security. Current systems often fail to address both accident prevention and theft detection comprehensively, leading to false alarms, vulnerabilities, and delayed responses. The increasing frequency of thefts and accidents highlights the need for an integrated solution with advanced sensors, real-time monitoring, and intuitive interfaces. This system aims to minimize false alarms, reduce response times, and provide robust protection, especially when the vehicle is off or the battery is removed.

4. Methodology

The system was developed using a user-centered approach, involving surveys, interviews, and observations with drivers, fleet operators, and car owners to identify safety and security needs. A literature review informed the selection of cost-effective, reliable components for drowsiness detection, alcohol/CO detection, tire pressure monitoring, battery theft, and tire theft. The system architecture integrates these sensors with a microcontroller, with software algorithms managing data and alerts. A prototype was built, tested for accuracy and reliability, and refined based on feedback from drivers and experts to meet safety standards.

4.1 System Architecture

The system employs a dual-microcontroller setup with an Arduino Mega 2560 as the primary controller and an Arduino Nano as a sensor node, communicating via serial protocols. Sensors include drowsiness, alcohol/CO, tire pressure, and theft detection modules, interfaced with SIM900A GSM and Neo-6M GPS modules for alerts and tracking. A BTS7960 H-Bridge drives power windows for ventilation.

4.2 Component Testing

Components were tested for accuracy, responsiveness, and compatibility to ensure reliable operation across various conditions.

4.3 Prototype Development

The prototype integrates hardware and software, with iterative testing and feedback-driven refinements to enhance functionality and usability.

Figure 2: Software Simulation

Software simulation

Figure 2: Software simulation of the system’s sensor data processing and alert mechanisms.

5. Hardware Implementation

The system uses a dual-microcontroller architecture with an Arduino Mega 2560 as the main controller and an Arduino Nano as a dedicated sensor node, improving performance, hardware distribution, and maintenance. The Mega, powered via USB, oversees core activities, interfacing with SIM900A GSM and Neo-6M GPS modules for alerts and tracking, and a BTS7960 H-Bridge for power window control. The Nano, powered by a USB power bank, handles sensor data (crash, gas, battery/tire theft), preventing overcurrent issues. A common ground ensures stable analog readings and communication. The system operates independently of the vehicle’s battery, ensuring functionality when the car is off.

Figure 3: Automobile and Theft Prevention System

System overview

Figure 3: Overview of the Automobile Accident and Theft Prevention System.

6. Design Calculations

6.1 Power Window Calculations

Calculations for the BTS7960 H-Bridge ensure sufficient current and voltage for power window operation, optimized for energy efficiency.

Figure 4: Power Window Calculations

Power window calculations

Figure 4: Calculations for power window control using BTS7960 H-Bridge.

6.2 Gas Sensor Calculations

Gas sensor calibration ensures accurate detection of CO and alcohol levels, triggering ventilation when thresholds are exceeded.

Figure 5: Gas Sensor Calculations

Gas sensor calculations

Figure 5: Gas sensor calibration calculations .

Figure 6: Gas Sensor Results

Gas sensor results

Figure 6: Results of gas sensor detection tests.

7. Results and Discussions

Testing across various vehicles under real-world conditions confirmed the system’s reliability. Battery theft triggered immediate alarms and user notifications via calls. Crash detection sent SMS alerts with GPS coordinates, accompanied by an alarm. Gas detection activated window ventilation upon detecting harmful gases, and tire theft sensors accurately detected removal, sending warning messages. The system’s independence from the vehicle’s battery ensured functionality when off. Limitations include weak network coverage affecting alerts, lack of a user-friendly interface, power bank charging requirements, and sensor vulnerability in harsh environments. Future improvements include enhanced network resilience, improved interfaces, and protective sensor housing.

Figure 7: Working of Crash Module and Battery Theft

Crash and battery theft

Figure 7: Demonstration of crash detection and battery theft alerts.

8. Conclusions

The Automobile Accident and Theft Prevention System represents a significant advancement in vehicle safety and security. By integrating sensors for drowsiness, alcohol/CO, crash, battery, and tire theft detection, it addresses critical challenges such as driver fatigue, gas poisoning, accidents, and component theft. Successful implementation in a real vehicle demonstrates its potential as a reliable, cost-effective solution. This project contributes to automotive safety, serves as a learning experience in applying engineering principles, and lays the foundation for future development and commercialization of advanced safety and security systems.

9. Author Contributions

Conceptualization, M.A.; methodology, A.A, M.A and M.S; software, M.A; validation, A.S, M.A and A.A; formal analysis, A.S; investigation, M.S; resources, A.A, M.A and M.N; data curation, M.S, A.A, M.A and A.S; writing original draft preparation, M.A.; writing review and editing, M.A and A.A; visualization, M.S, A.A, M.A and M.S; supervision, A.A; project administration, A.A; funding acquisition, M.A, A.A and M.S. All authors have read and agreed to the published version of the manuscript.

10. Funding and Declarations

This research received no external funding.

11. Institutional Review Board Statement

This research received no external funding.

12. Informed Consent Statement

Not applicable.

13. Data Availability Statement

The data presented in this study are available on request from the corresponding author, M.A. The data are not publicly available due to restrictions e.g. their containing information that could compromise the privacy of research participants.

14. Conflicts of Interest

The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the result

15. Code Implementation

The following Arduino code outlines the system’s functionality for crash, gas, and theft detection. Replace with actual code if available.

 <>

MQ7 CO Detection Module:

define MQPin A2 define motorPin1 8 define motorPin2 7 define enablePin 9 bool windowIsDown = false; unsigned long motorStartTime; bool motorRunning = false; bool lastGasValue = LOW; void setup() Serial.begin(9600); pinMode(enablePin, OUTPUT); pinMode(motorPin1, OUTPUT); pinMode(motorPin2, OUTPUT); digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, LOW); analogWrite(enablePin, 0); void loop() int gasValue = digitalRead(MQPin); Serial.print(”Gas Value: ”); Serial.println(gasValue); if (gasValue == HIGH && lastGasValue == LOW && !motorRunning && !windowIsDown) Serial.println(”Gas detected! Lowering window...”); digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, LOW); analogWrite(enablePin, 255); motorStartTime = millis(); motorRunning = true; lastGasValue = HIGH; else if (gasValue == LOW && lastGasValue == HIGH && !motorRunning && windowIsDown) Serial.println(”No gas detected! Raising window...”); digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, HIGH); analogWrite(enablePin, 255); motorStartTime = millis(); motorRunning = true; lastGasValue = LOW; if (motorRunning && (millis() - motorStartTime ¿= 3000)) analogWrite(enablePin, 0); digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, LOW); windowIsDown = lastGasValue == HIGH; motorRunning = false; Serial.println(”Motor stopped.”); delay(100);

Drowsiness Glasses:

const int irSensorPin = 5; const int buzzerPin = 6; void setup() pinMode(irSensorPin, INPUT); pinMode(buzzerPin, OUTPUT); digitalWrite(buzzerPin, LOW); void loop() int sensorState = digitalRead(irSensorPin); if (sensorState == HIGH) digitalWrite(buzzerPin, HIGH); else digitalWrite(buzzerPin, LOW); delay(100);

Theft System:

include ¡SoftwareSerial.h¿ SoftwareSerial gsm(10, 11); const int fsrPin = A1; const int threshold = 100; bool callMade = false; void setup() Serial.begin(9600); gsm.begin(9600); delay(1000); Serial.println(”Setup complete. Monitoring FSR values...”); void loop() int fsrValue = analogRead(fsrPin); Serial.print(”FSR Value: ”); Serial.println(fsrValue); if (fsrValue ¡ threshold && !callMade) makeCall(”+923171141678”); Serial.println(”Your battery is stolen!”); callMade = true; else if (fsrValue ¿= threshold && callMade) callMade = false; delay(100); makeCall(const char* phoneNumber) gsm.print(”ATD”); gsm.print (phoneNumber); gsm.println(”;”); delay(1000);

Sensor:

Serial.println(”Calling...”); const int mq2Pin = A0; const int buzzerPin = 6; const int gasThreshold = 300; void setup() pinMode(mq2Pin, INPUT); pinMode(buzzerPin, OUTPUT); digitalWrite(buzzerPin, LOW); Serial.begin(9600); void loop() int gasValue = analogRead(mq2Pin); Serial.print(”Gas Value: ”); Serial.println(gasValue); if (gasValue ¿ gasThreshold) digitalWrite(buzzerPin, HIGH); else digitalWrite(buzzerPin, LOW); delay(100);

I2C Slave Code:

#include ¡Wire.h¿ define MQ2P INA2 def ineIRP INA3 def ineCRASHP INA1 def ineT HEF TP INA0 uint8tsensorData[8]; booldataRequested = f alse; void setup() Wire.begin(0x08); // Use address 0x08 Wire.onRequest(requestEvent); Serial.begin(115200); Serial.println(”Nano Slave Ready”); void loop() updateSensorData(); if(dataRequested) Serial.println(”Data was requested since last update”); dataRequested = false; delay(50); void updateSensorData() uint16tmq2V alue = analogRead(MQ2P IN); uint16tirV alue = analogRead(IRP IN); uint16tcrashV alue = analogRead(CRASHP IN); uint16tthef tV alue = analogRead(T HEF TP IN); sensorData[0] = mq2Value » 8; sensorData[1] = mq2Value 0xFF; sensorData[2] = irValue » 8; sensorData[3] = irValue 0xFF; sensorData[4] = crashValue » 8; sensorData[5] = crashValue 0xFF; sensorData[6] = theftValue » 8; sensorData[7] = theftValue 0xFF; Serial.print(”Current Values: ”); Serial.print(mq2Value); Serial.print(”, ”); Serial.print(irValue); Serial.print(”, ”); Serial.print(crashValue); Serial.print(”, ”); Serial.println(theftValue); void requestEvent() dataRequested = true; Wire.write(sensorData, 8); Serial.println(”Sent 8 bytes”); // Master Code // === Final Year Project: Full Integrated System === // Crash + Battery Theft + Tyre Theft + Smoke Detection + GSM + GPS + Window Lowering + SMS Control include ¡Wire.h¿ define GPS Serial1 define GSM Serial2 define BUZZERP IN7 def ineREN2 def ineLEN3 def ineRPWM5 def ineLPWM6 define SLAVEADDR0x08 bool crashDetected = false; bool theftDetected = false; bool tyreAlerted = false; bool coAlerted = false; bool ignoreSensors = false; unsigned long ignoreUntil = 0; void setup() Wire.begin(); Serial.begin(9600); GPS.begin(9600); GSM.begin(9600); pinMode(BUZZERP IN, OUT P UT); digitalW rite(BUZZERP IN, LOW); pinMode(REN, OUT P UT); digitalW rite(REN, HIGH); pinMode(LEN, OUT P UT); digitalW rite(LEN, HIGH); pinMode(RPWM, OUT P UT); analogW rite(RPWM, 0); pinMode(LPWM, OUT P UT); analogW rite(LPWM, 0); GSM.println(”AT+CMGF=1”); delay(1000); GSM.println(”AT+CNMI=1,2,0,0,0”); delay(1000); Serial.println(”System Initialized ”); void loop() checkIncomingSMS(); if (ignoreSensors millis() ¡ ignoreUntil) Serial.println(” Ignoring events after RESET...”); delay(500); return; uint8tdata[8]; W ire.requestF rom(SLAV EADDR, 8); for(inti = 0; i < 8W ire.available(); i + +)data[i] = W ire.read(); uint16tmq2 = (data[0] << 8)|data[1]; uint16tir = (data[2] << 8)|data[3]; uint16tcrash = (data[4] << 8)|data[5]; uint16tthef t = (data[6] << 8)|data[7]; Serial.print(”MQ2: ”); Serial.print(mq2); Serial.print(” — IR: ”); Serial.print(ir); Serial.print(” — Crash FSR: ”); Serial.print(crash); Serial.print(” — Theft FSR: ”); Serial.println(theft); // Crash Detection if (crash ¿ 700 !crashDetected) String location = getGPSLocation(); Serial.println(” Crash Detected!”); digitalWrite(BUZZERP IN, HIGH); sendSMS(”CrashDetected! : ”, location); crashDetected = true; // Battery Theft Detection if (theft ¡ 50 !theftDetected) Serial.println(” Battery Theft Detected!”); digitalWrite(BUZZERP IN, HIGH); makeCall(); thef tDetected = true; //T yreT hef t if(ir > 500!tyreAlerted)Stringlocation = getGP SLocation(); Serial.println(”T yreStolen!”); sendSMS(”//SmokeDetection if(mq2 > 300!coAlerted)Stringlocation = getGP SLocation(); Serial.println(”SmokeDetected!Loweringwdelay(1000); // === GSM GPS === void sendSMS(String msg, String location) GSM.println(”AT+CMGS=+923171141678 ¨ ¨”); delay(1000); GSM.print(msg); if (location != ”Location not found”) GSM.print(”https://www.google.com/maps/place/”); GSM.print(location); else GSM.print(”Location not available”); GSM.write(26); Serial.println(” SMS Sent!”); void makeCall() GSM.println(”ATD+923171141678;”); delay(10000); GSM.println(”ATH”); Serial.println(” Call Made!”); void checkIncomingSMS() if (GSM.available()) String sms = GSM.readString(); sms.toUpperCase(); Serial.println(”Received SMS: ” + sms); if (sms.indexOf(”STOP”) ¿= 0) digitalWrite(BUZZERP IN, LOW); Serial.println(”BuzzerturnedOF F bySMS!”); if(sms.indexOf(”RESET”) >= 0)crashDetected = f alse;thef tDetected = f alse;tyreAlerted = f alse; StringgetGP SLocation()StringgpsSentence = ””; Stringlatitude = ””; Stringlongitude = ””; unsignedloint latStart = nthIndexOf(gpsSentence, ’,’, 2); int latEnd = nthIndexOf(gpsSentence, ’,’, 3); int lonStart = nthIndexOf(gpsSentence, ’,’, 4); int lonEnd = nthIndexOf(gpsSentence, ’,’, 5); String rawLat = gpsSentence.substring(latStart + 1, latEnd); String rawLon = gpsSentence.substring(lonStart + 1, lonEnd); if (rawLat.length() ¿ 0 rawLon.length() ¿ 0) float lat = convertLat(rawLat); float lon = convertLon(rawLon); if (lat != 0.0 lon != 0.0) return String(lat, 6) + ”,” + String(lon, 6); gpsSentence = ””; return ”Location not found”; int nthIndexOf(String str, char ch, int n) int pos = -1; while (n– ¿ 0) pos = str.indexOf(ch, pos + 1); if (pos == -1) break; return pos; float convertLat(String raw) if (raw.length() ¡ 6) return 0.0; float degrees = raw.substring(0, 2).toFloat(); float minutes = raw.substring(2).toFloat(); return degrees + (minutes / 60.0); float convertLon(String raw) if (raw.length() ¡ 6) return 0.0; float degrees = raw.substring(0, 3).toFloat(); float minutes = raw.substring(3).toFloat(); return degrees + (minutes / 60.0);

12. Supplementary Material

A full demonstration of the project is available, showcasing live testing of crash detection, tire theft alerts, gas response, and battery theft simulation under real-world conditions.

13. References

  • Kumar, R., Bansal, M., & Singh, S. (2020). Low-Cost Embedded Safety Systems for Smart Vehicles. IEEE Sensors Journal, 20(10), 5500–5508. https://doi.org/10.1109/JSEN.2020.2971234
  • Rao, P. S., & Kumar, V. (2018). Implementation of a Low-Cost Accident Detection and Messaging System Using Arduino UNO. In Proc. 4th Int. Conf. on Computing, Communication and Automation (ICCCA), Greater Noida, India, pp. 1–5.
  • Hossain, M., & Hassan, M. H. (2019). Design of a Cost-Efficient GPS-GSM Based Tracking System for Vehicles. In Proc. Int. Conf. on Electrical, Computer and Communication Engineering (ECCE), Cox’s Bazar, Bangladesh, pp. 1–5.
  • Jain, A., & Sharma, P. P. (2020). A Review on Integrated Vehicle Theft Detection and Accident Alert System. Int. J. Sci. Res. Sci. Eng. Technol., 6(2), 394–398.
  • Kumar, R., Bansal, M., & Singh, S. (2020). Low-Cost Embedded Safety Systems for Smart Vehicles. IEEE Sensors Journal, 20(10), 5500–5508. https://doi.org/10.1109/JSEN.2020.2971234
  • Jain, A., & Sharma, P. P. (2020). A Review on Integrated Vehicle Theft Detection and Accident Alert System. Int. J. Sci. Res. Sci. Eng. Technol., 6(2), 394–398.
  • Islam, M. S., & Rahman, M. A. (2016). Design and Development of Smart Vehicle Accident Detection System. In Proc. 3rd Int. Conf. on Electrical Engineering and Information & Communication Technology (IEEEICT), Dhaka, Bangladesh, pp. 1–6.
  • Venkatesh, P. V. R., & Biradar, S. R. (2016). Smart Vehicle Accident Detection and Alert System. Int. J. Eng. Technol., 38(7), 340–344.
  • Ali, J. A. R. A., Zalkerman, M. A., & Aloud, F. (2010). A Mobile GPRS-Sensors Array for Air Pollution Monitoring. IEEE Sensors Journal, 10(10), 1666–1677.
  • Jose, J. L., & George, S. (2017). Design and Implementation of Vehicle Theft Detection and Accident Detection Monitoring. In Proc. Int. Conf. on Information Science and Systems, India, pp. 107–111.
  • Patel, R., & Patel, H. (2017). Vehicle Tracking and Accident Alert System Using GPS and GSM. Int. J. Eng. Dev. Res., 5(4), 430–435.